package com.scott.ch010;

import redis.clients.jedis.Jedis;

/**
 * @author 黄后林
 * @version 1.0
 * @note 连上Redis6并做最简单的测试
 * @date 2022-03-25 10:05:17
 * 127.0.0.1:6379> ping
 * PONG
 * 127.0.0.1:6379> PING
 * PONG
 * redis.conf中注释掉 bind 127.0.0.1 、然后 protected-mode no
 * 关闭防火墙
 * systemctl status firewall
 * systemctl stop firewalld
 */
public class Hello {


    public static void main(String[] args) {
        Jedis jedis = new Jedis("192.168.88.129", 6379);

        //发起PING请求后、如果连接成功返回PONG、如果连接失败会报错
        String pong = jedis.ping();
        System.out.println("pong="+pong);

        jedis.close();
    }
}
